-
Notifications
You must be signed in to change notification settings - Fork 582
feat: Add support for token based pagination strategy #887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for token-based pagination strategy to the Twilio PHP SDK by introducing a new TokenPaginationPage class that extends the existing Page class. This allows handling of APIs that use nextToken and previousToken instead of URL-based pagination.
Key Changes:
- Introduced
TokenPaginationPageclass with token-based URL construction logic - Added
KeyErrorExceptionfor handling missing metadata keys - Added comprehensive unit tests and integration test to verify streaming behavior
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 15 comments.
| File | Description |
|---|---|
| src/Twilio/TokenPaginationPage.php | New abstract class implementing token-based pagination by overriding URL generation methods to construct URLs with pageSize and pageToken query parameters |
| src/Twilio/Exceptions/KeyErrorException.php | New exception class for handling cases where required 'key' metadata is missing from API responses |
| tests/Twilio/Unit/TokenPaginationPageTest.php | Comprehensive unit tests covering constructor, URL generation, query string building, and edge cases for the TokenPaginationPage class |
| tests/Twilio/Unit/VersionTest.php | Added integration test using TestTokenPage to verify token pagination works correctly with the existing Version.stream() method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…getPreviousPageUrl()
Co-authored-by: Copilot <[email protected]>
…oken_pagination # Conflicts: # src/Twilio/TokenPaginationPage.php
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|



Fixes DII-2111
Adding Token Pagination strategy
Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.